package com.guangli.ocr.viewmodel

import android.app.Application
import androidx.databinding.ObservableField
import com.guangli.base.base.vm.RobotBaseViewModel
import me.goldze.mvvmhabit.binding.command.BindingAction
import me.goldze.mvvmhabit.binding.command.BindingCommand
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent

class VehicleLicenseViewModel(application: Application):RobotBaseViewModel(application) {
    //证号
    val cardNum = ObservableField<String>()

    //车辆类型
    val carType = ObservableField<String>()

    //姓名
    val name = ObservableField<String>()


    //住址
    val address = ObservableField<String>()

    //使用性质
    val usingNature = ObservableField<String>()

    //品牌型号
    val brandModel = ObservableField<String>()

    //车辆识别代号
    val vehicleIdentificationCode = ObservableField<String>()

    //发动机号码
    val engineNum = ObservableField<String>()

    //注册日期
    val registrationDate = ObservableField<String>()

    //发证日期
    val releaseDate = ObservableField<String>()
    //发证单位
    val licenseIssuingUnit = ObservableField<String>()


    //证号
    val deputyCardNum = ObservableField<String>()

    //档案编号
    val fileNum = ObservableField<String>()

    //核定载人数
    val authorizedCapacity = ObservableField<String>()

    //总质量
    val totalQuality = ObservableField<String>()

    //整备质量
    val curbWeight = ObservableField<String>()

    //核定载质量
    val approvedLoadMass = ObservableField<String>()

    //外廓尺寸
    val outsideProfileSize = ObservableField<String>()

    //准牵引总质量
    val quasiTotalMass = ObservableField<String>()

    //备注
    val remark = ObservableField<String>()

    //检验记录
    val inspectionRecord = ObservableField<String>()

    //燃油记录
    val fuelRecord = ObservableField<String>()

    //证芯编号
    val theCoreCode = ObservableField<String>()

    val isAndThe = ObservableField<Boolean>(true)

//    val isAndTheLiveEvent = SingleLiveEvent<String>()
    val theOnclick = BindingCommand<Any>(BindingAction {
        isAndThe.set(false)
//        isAndTheLiveEvent.postValue("1")
        cardNum.set("")
        name.set("")
        address.set("")
        licenseIssuingUnit.set("")
    })

    val isOnclick = BindingCommand<Any>(BindingAction {
        isAndThe.set(true)
//        isAndTheLiveEvent.postValue("0")
        deputyCardNum.set("")
        fileNum.set("")
    })
}